#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
bool vis[N];
int r[N],n,ans;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        r[x]++;
    }
    queue<int>q;
    ans=n;
    for(int i=0;i<N;i++){
        if(r[i]==0)    continue;
        if(q.empty()==1){
            q.push(i);
            continue;
        }
        q.push(i);
        for(int k=0;k<r[i];k++){
            r[q.front()]--;
            ans--;
            if(r[q.front()]==0) q.pop();
        }
    }
    cout<<ans;
    return 0;
}
